package com.erp.module.jiehao.scJieHao

import android.content.Context
import android.util.Log
import com.erp.contacts.Contacts
import com.erp.Interface.OnUserDataInterface
import com.erp.util.Httputil.*
import org.xutils.http.RequestParams
import org.xutils.x


/**
 * Created by Administrator on 2019/3/19/019.
 * 作者：刘洋
 */
class ScJieHaoModel {
    fun addjiehao(context : Context, jo : String ,code : Int ,onUserDataInterface : OnUserDataInterface){
        Log.d("TAAG", "ssssssssssssssssssssssss")
        val params: RequestParams
        if (code == 1) {
            params = RequestParams(Contacts.GET_JIEHAO_SHUJU)
        } else {
            params = RequestParams(Contacts.GET_ZHIXIANG_SHUJU)
        }
        getparams(context, params)
        addtoken(params)
        params.addHeader("Content-Type", "application/json")
        params.bodyContent = jo
        x.http().post(params, Call(context, onUserDataInterface))
    }
}